<%@page import="com.google.appengine.api.datastore.Query.FilterOperator"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page  import=" com.google.appengine.api.datastore.* " %>
<%@page import="java.util.List " %>
<%@page import="java.io.PrintWriter" %>
<%@page import="nl.project.data.Parent" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%

	DatastoreService d = DatastoreServiceFactory.getDatastoreService();
	
	Query j = new Query("student").addFilter("studentId",FilterOperator.EQUAL,(Integer.parseInt( request.getParameter("studentId"))));
	PreparedQuery pq =  d.prepare(j);
	Key k = pq.asSingleEntity().getKey();
	Query q =  new Query("vak" , k) ;
	List<Entity> l = d.prepare(q).asList(FetchOptions.Builder.withDefaults());

	Parent parent = (Parent) session.getAttribute("parent");
	
%>

==>ik moet weten wie de ouder is en welke student de ouder bedoeld

<form action="/AppointmentProcess" method="post">


<input type="hidden" name="studentId"  value="<%= request.getParameter("student_id") %> "/>
<input type="hidden" name="parentId"  value="<%= parent.getParentId() %> "/>

<input type="radio"  name="pref" value="Early" /> voor 19:00 <br>
<input type="radio"  name="pref" value="Later" /> na 19:00	<br>
<input type="radio"  name="pref" value="None" /> geen voorkeur	<br>
<p> kies hier maximaal drie docenten it die u wilt spreken </p>

<%
PrintWriter p =  response.getWriter();
for(int i =0 ; i < l.size(); i++){
	
	p.println("<input type='checkbox' name='theacher"+i+"' value='"+ l.get(i).getProperty("theacherCode")+ "'/> "+ l.get(i).getProperty("courseName")+" gegeven door "+  l.get(i).getProperty("theacherName")+"  <br/>");
}
%>
<br>
		 <h3>Voorkeur dag:</h3>
		 <input type="checkbox" name="day1" value="1"> Dag 1 (zoveel november)<br />
		 <input type="checkbox" name="day2" value="1"> Dag 2 (zoveel november)<br />
		 <input type="checkbox" name="day3" value="1"> Dag 3 (zoveel november)<br />
		 <input type="checkbox" name="day_no_pref" value="0"> Geen voorkeur	<br />


<input type="submit" value="inplannen" />
</form>



</body>
</html>